Optimal. Leaf size=255 \[ -\frac {(11 A+4 i B) \cot ^2(c+d x)}{2 a^4 d}+\frac {5 (-13 B+35 i A) \cot (c+d x)}{16 a^4 d}-\frac {(11 A+4 i B) \log (\sin (c+d x))}{a^4 d}+\frac {5 (35 A+13 i B) \cot ^2(c+d x)}{48 a^4 d (1+i \tan (c+d x))}+\frac {(43 A+17 i B) \cot ^2(c+d x)}{48 a^4 d (1+i \tan (c+d x))^2}+\frac {5 x (-13 B+35 i A)}{16 a^4}+\frac {(2 A+i B) \cot ^2(c+d x)}{6 a d (a+i a \tan (c+d x))^3}+\frac {(A+i B) \cot ^2(c+d x)}{8 d (a+i a \tan (c+d x))^4} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.79, antiderivative size = 255, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 4, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {3596, 3529, 3531, 3475} \[ -\frac {(11 A+4 i B) \cot ^2(c+d x)}{2 a^4 d}+\frac {5 (-13 B+35 i A) \cot (c+d x)}{16 a^4 d}-\frac {(11 A+4 i B) \log (\sin (c+d x))}{a^4 d}+\frac {5 (35 A+13 i B) \cot ^2(c+d x)}{48 a^4 d (1+i \tan (c+d x))}+\frac {(43 A+17 i B) \cot ^2(c+d x)}{48 a^4 d (1+i \tan (c+d x))^2}+\frac {5 x (-13 B+35 i A)}{16 a^4}+\frac {(2 A+i B) \cot ^2(c+d x)}{6 a d (a+i a \tan (c+d x))^3}+\frac {(A+i B) \cot ^2(c+d x)}{8 d (a+i a \tan (c+d x))^4} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3529
Rule 3531
Rule 3596
Rubi steps
\begin {align*} \int \frac {\cot ^3(c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^4} \, dx &=\frac {(A+i B) \cot ^2(c+d x)}{8 d (a+i a \tan (c+d x))^4}+\frac {\int \frac {\cot ^3(c+d x) (2 a (5 A+i B)-6 a (i A-B) \tan (c+d x))}{(a+i a \tan (c+d x))^3} \, dx}{8 a^2}\\ &=\frac {(A+i B) \cot ^2(c+d x)}{8 d (a+i a \tan (c+d x))^4}+\frac {(2 A+i B) \cot ^2(c+d x)}{6 a d (a+i a \tan (c+d x))^3}+\frac {\int \frac {\cot ^3(c+d x) \left (4 a^2 (23 A+7 i B)-40 a^2 (2 i A-B) \tan (c+d x)\right )}{(a+i a \tan (c+d x))^2} \, dx}{48 a^4}\\ &=\frac {(43 A+17 i B) \cot ^2(c+d x)}{48 a^4 d (1+i \tan (c+d x))^2}+\frac {(A+i B) \cot ^2(c+d x)}{8 d (a+i a \tan (c+d x))^4}+\frac {(2 A+i B) \cot ^2(c+d x)}{6 a d (a+i a \tan (c+d x))^3}+\frac {\int \frac {\cot ^3(c+d x) \left (8 a^3 (89 A+31 i B)-16 a^3 (43 i A-17 B) \tan (c+d x)\right )}{a+i a \tan (c+d x)} \, dx}{192 a^6}\\ &=\frac {(43 A+17 i B) \cot ^2(c+d x)}{48 a^4 d (1+i \tan (c+d x))^2}+\frac {(A+i B) \cot ^2(c+d x)}{8 d (a+i a \tan (c+d x))^4}+\frac {(2 A+i B) \cot ^2(c+d x)}{6 a d (a+i a \tan (c+d x))^3}+\frac {5 (35 A+13 i B) \cot ^2(c+d x)}{48 d \left (a^4+i a^4 \tan (c+d x)\right )}+\frac {\int \cot ^3(c+d x) \left (384 a^4 (11 A+4 i B)-120 a^4 (35 i A-13 B) \tan (c+d x)\right ) \, dx}{384 a^8}\\ &=-\frac {(11 A+4 i B) \cot ^2(c+d x)}{2 a^4 d}+\frac {(43 A+17 i B) \cot ^2(c+d x)}{48 a^4 d (1+i \tan (c+d x))^2}+\frac {(A+i B) \cot ^2(c+d x)}{8 d (a+i a \tan (c+d x))^4}+\frac {(2 A+i B) \cot ^2(c+d x)}{6 a d (a+i a \tan (c+d x))^3}+\frac {5 (35 A+13 i B) \cot ^2(c+d x)}{48 d \left (a^4+i a^4 \tan (c+d x)\right )}+\frac {\int \cot ^2(c+d x) \left (-120 a^4 (35 i A-13 B)-384 a^4 (11 A+4 i B) \tan (c+d x)\right ) \, dx}{384 a^8}\\ &=\frac {5 (35 i A-13 B) \cot (c+d x)}{16 a^4 d}-\frac {(11 A+4 i B) \cot ^2(c+d x)}{2 a^4 d}+\frac {(43 A+17 i B) \cot ^2(c+d x)}{48 a^4 d (1+i \tan (c+d x))^2}+\frac {(A+i B) \cot ^2(c+d x)}{8 d (a+i a \tan (c+d x))^4}+\frac {(2 A+i B) \cot ^2(c+d x)}{6 a d (a+i a \tan (c+d x))^3}+\frac {5 (35 A+13 i B) \cot ^2(c+d x)}{48 d \left (a^4+i a^4 \tan (c+d x)\right )}+\frac {\int \cot (c+d x) \left (-384 a^4 (11 A+4 i B)+120 a^4 (35 i A-13 B) \tan (c+d x)\right ) \, dx}{384 a^8}\\ &=\frac {5 (35 i A-13 B) x}{16 a^4}+\frac {5 (35 i A-13 B) \cot (c+d x)}{16 a^4 d}-\frac {(11 A+4 i B) \cot ^2(c+d x)}{2 a^4 d}+\frac {(43 A+17 i B) \cot ^2(c+d x)}{48 a^4 d (1+i \tan (c+d x))^2}+\frac {(A+i B) \cot ^2(c+d x)}{8 d (a+i a \tan (c+d x))^4}+\frac {(2 A+i B) \cot ^2(c+d x)}{6 a d (a+i a \tan (c+d x))^3}+\frac {5 (35 A+13 i B) \cot ^2(c+d x)}{48 d \left (a^4+i a^4 \tan (c+d x)\right )}-\frac {(11 A+4 i B) \int \cot (c+d x) \, dx}{a^4}\\ &=\frac {5 (35 i A-13 B) x}{16 a^4}+\frac {5 (35 i A-13 B) \cot (c+d x)}{16 a^4 d}-\frac {(11 A+4 i B) \cot ^2(c+d x)}{2 a^4 d}-\frac {(11 A+4 i B) \log (\sin (c+d x))}{a^4 d}+\frac {(43 A+17 i B) \cot ^2(c+d x)}{48 a^4 d (1+i \tan (c+d x))^2}+\frac {(A+i B) \cot ^2(c+d x)}{8 d (a+i a \tan (c+d x))^4}+\frac {(2 A+i B) \cot ^2(c+d x)}{6 a d (a+i a \tan (c+d x))^3}+\frac {5 (35 A+13 i B) \cot ^2(c+d x)}{48 d \left (a^4+i a^4 \tan (c+d x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 7.63, size = 1625, normalized size = 6.37 \[ \text {result too large to display} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.75, size = 249, normalized size = 0.98 \[ \frac {{\left (8424 i \, A - 3096 \, B\right )} d x e^{\left (12 i \, d x + 12 i \, c\right )} + {\left ({\left (-16848 i \, A + 6192 \, B\right )} d x - 4104 \, A - 1632 i \, B\right )} e^{\left (10 i \, d x + 10 i \, c\right )} + {\left ({\left (8424 i \, A - 3096 \, B\right )} d x + 6384 \, A + 2316 i \, B\right )} e^{\left (8 i \, d x + 8 i \, c\right )} - 8 \, {\left (158 \, A + 67 i \, B\right )} e^{\left (6 i \, d x + 6 i \, c\right )} - {\left (211 \, A + 119 i \, B\right )} e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, {\left (17 \, A + 13 i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - 384 \, {\left ({\left (11 \, A + 4 i \, B\right )} e^{\left (12 i \, d x + 12 i \, c\right )} - 2 \, {\left (11 \, A + 4 i \, B\right )} e^{\left (10 i \, d x + 10 i \, c\right )} + {\left (11 \, A + 4 i \, B\right )} e^{\left (8 i \, d x + 8 i \, c\right )}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right ) - 3 \, A - 3 i \, B}{384 \, {\left (a^{4} d e^{\left (12 i \, d x + 12 i \, c\right )} - 2 \, a^{4} d e^{\left (10 i \, d x + 10 i \, c\right )} + a^{4} d e^{\left (8 i \, d x + 8 i \, c\right )}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 5.27, size = 228, normalized size = 0.89 \[ \frac {\frac {12 \, {\left (A - i \, B\right )} \log \left (\tan \left (d x + c\right ) + i\right )}{a^{4}} + \frac {36 \, {\left (117 \, A + 43 i \, B\right )} \log \left (\tan \left (d x + c\right ) - i\right )}{a^{4}} - \frac {384 \, {\left (11 \, A + 4 i \, B\right )} \log \left (\tan \left (d x + c\right )\right )}{a^{4}} + \frac {192 \, {\left (33 \, A \tan \left (d x + c\right )^{2} + 12 i \, B \tan \left (d x + c\right )^{2} + 8 i \, A \tan \left (d x + c\right ) - 2 \, B \tan \left (d x + c\right ) - A\right )}}{a^{4} \tan \left (d x + c\right )^{2}} - \frac {8775 \, A \tan \left (d x + c\right )^{4} + 3225 i \, B \tan \left (d x + c\right )^{4} - 37764 i \, A \tan \left (d x + c\right )^{3} + 14076 \, B \tan \left (d x + c\right )^{3} - 61386 \, A \tan \left (d x + c\right )^{2} - 23286 i \, B \tan \left (d x + c\right )^{2} + 44804 i \, A \tan \left (d x + c\right ) - 17404 \, B \tan \left (d x + c\right ) + 12455 \, A + 5017 i \, B}{a^{4} {\left (\tan \left (d x + c\right ) - i\right )}^{4}}}{384 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.79, size = 329, normalized size = 1.29 \[ \frac {A \ln \left (\tan \left (d x +c \right )+i\right )}{32 d \,a^{4}}-\frac {i B}{8 d \,a^{4} \left (\tan \left (d x +c \right )-i\right )^{4}}-\frac {A}{2 a^{4} d \tan \left (d x +c \right )^{2}}-\frac {7 i A}{12 d \,a^{4} \left (\tan \left (d x +c \right )-i\right )^{3}}-\frac {11 A \ln \left (\tan \left (d x +c \right )\right )}{a^{4} d}+\frac {129 i \ln \left (\tan \left (d x +c \right )-i\right ) B}{32 d \,a^{4}}-\frac {B}{a^{4} d \tan \left (d x +c \right )}-\frac {A}{8 d \,a^{4} \left (\tan \left (d x +c \right )-i\right )^{4}}-\frac {i B \ln \left (\tan \left (d x +c \right )+i\right )}{32 d \,a^{4}}-\frac {49 B}{16 d \,a^{4} \left (\tan \left (d x +c \right )-i\right )}+\frac {4 i A}{a^{4} d \tan \left (d x +c \right )}+\frac {31 A}{16 d \,a^{4} \left (\tan \left (d x +c \right )-i\right )^{2}}+\frac {111 i A}{16 d \,a^{4} \left (\tan \left (d x +c \right )-i\right )}+\frac {5 B}{12 d \,a^{4} \left (\tan \left (d x +c \right )-i\right )^{3}}+\frac {17 i B}{16 d \,a^{4} \left (\tan \left (d x +c \right )-i\right )^{2}}+\frac {351 \ln \left (\tan \left (d x +c \right )-i\right ) A}{32 d \,a^{4}}-\frac {4 i B \ln \left (\tan \left (d x +c \right )\right )}{a^{4} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 7.64, size = 251, normalized size = 0.98 \[ \frac {{\mathrm {tan}\left (c+d\,x\right )}^4\,\left (\frac {153\,A}{4\,a^4}+\frac {B\,57{}\mathrm {i}}{4\,a^4}\right )+{\mathrm {tan}\left (c+d\,x\right )}^5\,\left (-\frac {65\,B}{16\,a^4}+\frac {A\,175{}\mathrm {i}}{16\,a^4}\right )-{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (\frac {271\,A}{12\,a^4}+\frac {B\,26{}\mathrm {i}}{3\,a^4}\right )-{\mathrm {tan}\left (c+d\,x\right )}^3\,\left (-\frac {851\,B}{48\,a^4}+\frac {A\,2269{}\mathrm {i}}{48\,a^4}\right )-\frac {A}{2\,a^4}+\mathrm {tan}\left (c+d\,x\right )\,\left (-\frac {B}{a^4}+\frac {A\,2{}\mathrm {i}}{a^4}\right )}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^6-{\mathrm {tan}\left (c+d\,x\right )}^5\,4{}\mathrm {i}-6\,{\mathrm {tan}\left (c+d\,x\right )}^4+{\mathrm {tan}\left (c+d\,x\right )}^3\,4{}\mathrm {i}+{\mathrm {tan}\left (c+d\,x\right )}^2\right )}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )\,\left (11\,A+B\,4{}\mathrm {i}\right )}{a^4\,d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (A-B\,1{}\mathrm {i}\right )}{32\,a^4\,d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (351\,A+B\,129{}\mathrm {i}\right )}{32\,a^4\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 2.12, size = 471, normalized size = 1.85 \[ \frac {8 i A - 2 B + \left (- 6 i A e^{2 i c} + 2 B e^{2 i c}\right ) e^{2 i d x}}{i a^{4} d e^{4 i c} e^{4 i d x} - 2 i a^{4} d e^{2 i c} e^{2 i d x} + i a^{4} d} + \begin {cases} \frac {\left (\left (- 24576 A a^{12} d^{3} e^{12 i c} - 24576 i B a^{12} d^{3} e^{12 i c}\right ) e^{- 8 i d x} + \left (- 327680 A a^{12} d^{3} e^{14 i c} - 262144 i B a^{12} d^{3} e^{14 i c}\right ) e^{- 6 i d x} + \left (- 2359296 A a^{12} d^{3} e^{16 i c} - 1474560 i B a^{12} d^{3} e^{16 i c}\right ) e^{- 4 i d x} + \left (- 14745600 A a^{12} d^{3} e^{18 i c} - 7077888 i B a^{12} d^{3} e^{18 i c}\right ) e^{- 2 i d x}\right ) e^{- 20 i c}}{3145728 a^{16} d^{4}} & \text {for}\: 3145728 a^{16} d^{4} e^{20 i c} \neq 0 \\x \left (- \frac {351 i A - 129 B}{16 a^{4}} + \frac {\left (351 i A e^{8 i c} + 150 i A e^{6 i c} + 48 i A e^{4 i c} + 10 i A e^{2 i c} + i A - 129 B e^{8 i c} - 72 B e^{6 i c} - 30 B e^{4 i c} - 8 B e^{2 i c} - B\right ) e^{- 8 i c}}{16 a^{4}}\right ) & \text {otherwise} \end {cases} - \frac {x \left (- 351 i A + 129 B\right )}{16 a^{4}} - \frac {\left (11 A + 4 i B\right ) \log {\left (e^{2 i d x} - e^{- 2 i c} \right )}}{a^{4} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________